package cn.ggsaas.base.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author liyuzhen
 * @date 2019/9/24 11:46 上午
 */
@EnableTransactionManagement
public class MybatisConfig {

    /**
     * SQL执行销量插件
     */
    @Bean
    // @Profile({Env.NOT_PRD})
    public PerformanceInterceptor performanceInterceptor() {
        return new PerformanceInterceptor();
    }

    /**
     * mybatis-plus 分页插件
     */
    @Bean
    @Order(Integer.MIN_VALUE)
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

//    /**
//     * 逻辑删除
//     */
//    @Bean
//    public ISqlInjector sqlInjector() {
//        return new LogicSqlInjector();
//    }

}
